home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / system / linux_bo / netboot.zoo / bootinc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-04  |  4.2 KB  |  146 lines

  1. #ifndef BOOTINC_H
  2. #define BOOTINC_H
  3.  
  4. #include "config.h"
  5.  
  6. #ifndef NULL
  7. #define NULL    (0)
  8. #endif
  9.  
  10. #ifdef DEBUG
  11. # define BUG(__s) n_printf("%s[%d]: %s\n",__FILE__,__LINE__,__s);
  12. # define VPRINT(s) n_putscrlf(s)
  13. #else
  14. # define BUG(__s)
  15. # define VPRINT(s)
  16. #endif
  17.  
  18. #ifndef MK_FP
  19. #define MK_FP(seg,ofs)  ((void far *) \
  20.                (((unsigned long)(seg) << 16) | (unsigned)(ofs)))
  21. #endif
  22.  
  23. /* because the reading of the buffer is syncronous with the
  24.    code, there is no need to have a large buffer
  25. */
  26.  
  27. #define RAW_LENGTH        (7000)
  28. #define RAW_END_LENGTH         (RAW_LENGTH - 2048)
  29. #define RAW_LIMIT_LENGTH    (RAW_END_LENGTH - 4096)
  30.  
  31. /*
  32. *   Declarations of global variables for TCP/IP libraries
  33. *
  34. ****************************************************************************
  35. *                                                                          *
  36. *                                                                          *
  37. *      NCSA Telnet                                                         *
  38. *      by Tim Krauskopf, VT100 by Gaige Paulsen, Tek by Aaron Contorer     *
  39. *                                                                          *
  40. *      National Center for Supercomputing Applications                     *
  41. *      152 Computing Applications Building                                 *
  42. *      605 E. Springfield Ave.                                             *
  43. *      Champaign, IL  61820                                                *
  44. *                                                                          *
  45. *    Copyright (c) 1987, Board of Trustees of the University of Illinois   *
  46. *                                                                          *
  47. ****************************************************************************
  48. *
  49. */
  50.  
  51. /*
  52. *  Start with declarations that tell the difference between PC and other
  53. *  computers
  54. */
  55.  
  56. extern unsigned char bseed[],
  57.                 ltseed[],
  58.                 raw[];
  59.  
  60. extern unsigned char
  61.                 nnmyaddr[DADDLEN],           /* my ethernet hardware
  62.                             * address */
  63.                 nnserveraddr[DADDLEN],           /* server's ethernet hardware
  64.                             * address */
  65.                 broadaddr[DADDLEN],           /* the broadcast address */
  66.                 nnipnum[4],               /* my ip number */
  67.                 nnipserver[4],               /* server's ip number */
  68.                 broadip[4];
  69.  
  70. extern int
  71.                 nnipident;               /* ident field of outgoing ip
  72.                             * packets */
  73.  
  74. extern int      debug;
  75.  
  76. extern struct pseudotcp tcps;               /* for checksums */
  77. extern struct pseudotcp utcps;               /* for checksums */
  78.  
  79. extern DLAYER   blankd;
  80. extern IPKT     blankip;
  81.  
  82. extern UDPKT    udp_rxdata;
  83. extern UDPKT    udpout;
  84.  
  85. extern int start_of_data;
  86. extern int end_of_data;
  87. extern int end_of_bss;
  88.  
  89. /*
  90. *   defines for types for functions, global to everyone
  91. */
  92. char           *nbgets();
  93. uint8          *getdlayer(), *netdlayer();
  94.  
  95. /*
  96. *   defines of constants and macros that everyone needs to know
  97. */
  98.  
  99.  
  100. /* net.c */
  101. #include "protocol.h"
  102.  
  103. extern int      netparms(uint irq, uint address, uint ioaddr, uint extra);
  104. extern void     netconfig(char *s);
  105. extern int      initbuffer(void);
  106. extern int      ethrecv(IPKT * p);
  107. extern int      dlayersend(struct ether * ptr, unsigned int size);
  108. extern int      dlayerinit(void);
  109. extern void     dlayershut(void);
  110. extern void     pcgetaddr(char *s, int x, int y);
  111.  
  112. /* udp.c */
  113. extern void     udpdump(UDPKT * p);
  114. extern int      udprecv(UDPKT * p, uint uport);
  115. extern int      netusend(unsigned char *machine, unsigned char *eaddr, uint port, uint retport, unsigned char *buffer, int n);
  116.  
  117. /* ip.c */
  118. extern void     ipdump(IPKT * p);
  119. extern int      iprecv(IPKT * p);
  120.  
  121. /*  arp.c */
  122. extern int arpinterpret(ARPKT *p);
  123.  
  124. /* bootp.c */
  125.  
  126. extern int      bootp(char *name, int len);
  127.  
  128. /*   tftp.c */
  129.  
  130. extern int      tftp_get(char *name);
  131.  
  132.  
  133. /* general */
  134. extern void     netposterr(int num);
  135. extern int      init(char *ifname);
  136. extern void     udp_reinit(void);
  137.  
  138. /* decoder */
  139. extern int     decode_header(void *ptr);
  140. extern int    place_data(char *data, int len);
  141. extern void    warp_speed_Mr_spock(void);
  142.  
  143. #include "utils.h"
  144.  
  145. #endif
  146.